/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tp1;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author tulio
 */
public class TesteReflection {
    
    private Integer teste;
    
    private String teste2;

    public int getTeste() {
        return teste;
    }

    public void setTeste(int teste) {
        this.teste = teste;
    }
    
    public void teste() {
        for(Field f: this.getClass().getDeclaredFields()){
            try {
                System.out.println(f.getName() + " = " + f.get(this));
            } catch (IllegalArgumentException ex) {
                Logger.getLogger(TesteReflection.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                Logger.getLogger(TesteReflection.class.getName()).log(Level.SEVERE, null, ex);
            }
            System.out.println(f.getType().getSimpleName());                                                 
            
        }
    }
    
}
